#ifndef DETAILEDVIDEOITEM_H
#define DETAILEDVIDEOITEM_H

#include <QWidget>
#include<QSqlDatabase>
#include<QSqlQuery>
#include<QLabel>
#include<QObject>
#include<QPropertyAnimation>
#include"evaluateitem.h"
#include<QListWidget>
#include<QMediaPlayer>
#include<QAudioOutput>
#include"videowidget.h"
#include"onevideoinfo.h"
#include"adjustrplayrate.h"
#include"peopleinfo.h"
#include"soundsum.h"
#include"smallvideoitem.h"
#include"databasemanage.h"
#include"historicalwatch.h"
#include"smalltalk.h"
#include"selectcollectitem.h"
#include"smallhistory.h"
#include"selectcollect.h"
#include"frienditem.h"
namespace Ui {
class detailedvideoitem;
}

class detailedvideoitem : public QWidget
{
    Q_OBJECT

public:
    explicit detailedvideoitem(QWidget*parent=nullptr);
    ~detailedvideoitem();
public:
    onevideoinfo* ov;  //视频信息
    QVector<onevideoinfo*> recommendov;  //推荐视频列表
    databasemanage* db;
    historicalwatch* hisw;
    bool talklistopen=false;
    peopleinfo* pi;
    QMediaPlayer*player;
    videowidget* vw;     //播放视频项
    adjustrplayrate* apr;  //调整倍速
    soundsum* ss;  //调整音量
    selectcollect* sc;  //选择收藏界面
    QListWidget* smallhislist;   //弹幕消息列表
    bool attention=false;
    bool talkopen=false;
    bool playstate=true;
    bool favor=false;
    bool coin=false;
    bool storage=false;
    QPoint dragPosition;
    QPoint dragPosition_pei;
    QPoint dragPosition_sound;
public:
    bool eventFilter(QObject *watched, QEvent *event);
    void init();
    void inithistorical(historicalwatch* his,QListWidget*li);
    void initprivateinfo(peopleinfo* pi);
    void initMedia();
    void initsqldatabase(databasemanage* db);  //针对用户操作直接修改数据库
    void initvideoinfo(onevideoinfo* ovi,QVector<onevideoinfo*> recommendov);
    void complementtalklist();     //填充弹幕列表
    void complementrecommendlist();  //填充推荐视频列表
    void initUi();
    void setmyimage(QString image);
    void addtselectcollectitem(QString name,int num);  //增加选择收藏界面的一个收藏选项
signals:
    void removeonevideofromcollect(QString collectname,int videoid);
    void addonevideotocollect(QString collectname,int videoid);
    void addsmallhistory(QString image,QString author,QString time,QString sign);
    void changecurvideoid(int id);
    void addonefriendrelation(frienditem*);
    void deleteonefriendrelation(QString name);
private slots:



    void on_sound_clicked();


    void on_play_clicked();

    void on_attention_2_clicked();

    void on_favor_clicked();

    void on_coin_clicked();


    void on_talkset_clicked();

    void on_sendtalk_clicked();

    void on_fullscreen_clicked();

    void on_pushButton_2_clicked();

    void on_pei_clicked();

    void on_storage_clicked();

    void on_pushButton_4_clicked();

    void on_issuebtn_clicked();

    void on_pushButton_clicked();

    void on_recommendvideolist_currentRowChanged(int currentRow);

private:
    Ui::detailedvideoitem *ui;
};

#endif // DETAILEDVIDEOITEM_H
